<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<h:form id="frmLogin" prependId="false">
		<h:panelGroup rendered="#{!authenticator.authenticated}">
			<p:growl id="messages" life="2000" showDetail="false" />

			<h:panelGrid columns="6" styleClass="grpLogin">

				<h:outputLabel for="username" styleClass="edtLogin"
					value="#{msg['usuario.label.nome']}" />
				<p:inputText id="username" required="true" styleClass="edtLogin"
					value="#{authenticator.username}"
					requiredMessage="#{msgValidation['usuario.nome.obrigatorio']}" />

				<h:outputLabel for="password" styleClass="edtLogin"
					value="#{msg['usuario.label.senha']}" />
				<p:password id="password" required="true" styleClass="edtLogin"
					value="#{authenticator.password}" feedback="false" minLength="1" 
					requiredMessage="#{msgValidation['usuario.senha.obrigatorio']}" />

				<p:commandButton value="Ok" styleClass="btnLogin" ajax="true"
					actionListener="#{authenticator.login}" update="frmLogin,menuContent,mainContent "/>
			</h:panelGrid>

		</h:panelGroup>
		<h:panelGroup>
			<h:panelGrid columns="2" styleClass="grpLogin"
				rendered="#{authenticator.authenticated}">
				<h:outputText value="#{authenticator.principal}" />
				<p:commandLink actionListener="#{authenticator.preLogout}" value="Sair"
					update="frmLogin menuContent mainContent">
					<f:setPropertyActionListener target="#{home.mainContent}"
						value="/teste" />
				</p:commandLink>
			</h:panelGrid>
		</h:panelGroup>
	</h:form>
</ui:composition>
